#include <iostream>
//在外部创建全局变量解决数组过大的问题
const int m = 2000000;
using namespace std;
//给第一个赋值为2，初始化质数列表
int all_number[m] = {2, 0};

int main() {
    int n, i, j;
    cin >> n;
    //生成2~n的所有整数
    for (i = 0; i < n; ++i) all_number[i] = i + 2;
    //筛选质数
    for (i = 1; i <= n; ++i) {
        for (j = 1; j <= i; ++j) {
        	//避免出现除以前面标记为0的错误
            if (all_number[j - 1] == 0) continue;
            else {
            	//判断是否可以整除前面的数
                if (all_number[i] % all_number[j - 1] == 0) {
                        //用零替换被筛掉的数
                        all_number[i] = 0;
                        break;
                }
            }
        }
    }
    //输出剩下的质数（非零）
    for (i = 0; i <= n; ++i) {
        if (all_number[i] != 0) {
            cout << all_number[i] << " ";
        }
    }
    return 0;
}
